﻿using SIG.Model.Identity;
using SIG.Model.ViewModel.Identity;
using SIG.ViewModel.Front.Identity;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace SIG.Service.Identity
{
    public interface IUserService : IEntityService<User>
    {
        List<User> GetPagedElements(int pageIndex, int pageSize, string keyword, DateTime? startDate, DateTime? endDate, int? roleId, out int totalCount);

        IList<User> SearchUsers(int pageIndex, int pageSize, string username, DateTime? startDate, DateTime? endDate);
        int SearchUsersCount(string username, DateTime? startDate, DateTime? endDate);
        int Register(string userName, string email, string password,string realName);
        Task<int> RegisterForAPI(RegisterIMForAPI vm);
        Task<User> SignIn(string username, string password, CancellationToken cancellationToken = default(CancellationToken));
        Task<User> SignInForAPI(string username, string password, CancellationToken cancellationToken = default(CancellationToken));
        List<Menu> GetUserMenus(Guid userId);
        void SetUserCookies(bool isPersist, User user);
        bool SetPassword(Guid userId, string password);
        int ChangePassword(Guid userId, string oldPassword, string newPassword);
        Task<bool> ResetPassword(string userName, string password);
        Task<User> GetUserByName(string userName, CancellationToken cancellationToken = default(CancellationToken));
        Task<User> GetUserByEmail(string email, CancellationToken cancellationToken = default(CancellationToken));
        bool IsEmailUniqueAtEdit(string email, Guid id);
    }
}